<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:f="http://java.sun.com/jsf/core"      
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
<meta http-equiv="Content-Language" content="cs" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="rychnov,nad,kněžnou,krajsky,přebor,fotbal" />
<meta name="description" content="Královéhradecký krajský fotbalový svaz" />
<meta name="author" content="Hubalek Jiri" />
<meta name="reply-to" content="hubalek.jiri.rk@seznam.cz" />
<meta name="Copyright" content="Copyright © 2012 FotbalVKraji.cz" />
<title>Královéhradecký krajský fotbalový svaz</title>
</h:head>
  <body >
  	<h:form>	
  									<h:panelGrid columns="1">
									<h:panelGroup>													
										<p:selectOneMenu value="#{customBean.selectedSeasonName}" style="width: 180px" >  
							                <f:selectItem  itemLabel="Vyberte sezónu" itemValue="" />  
							                <f:selectItems value="#{customBean.seasonNamesList}" />
							                <p:ajax update="competionSelect" listener="#{searchTeamBean.handleSeasonChange}" /> 
				            			</p:selectOneMenu>			            			 
			            			</h:panelGroup>
									<h:panelGroup>													
										<p:selectOneMenu id="competionSelect" value="#{customBean.selectedCompetionName}" style="width: 180px" >  
							                <f:selectItem itemLabel="Vyberte soutěž" itemValue="" />  
							                <f:selectItems value="#{searchTeamBean.competionNameList}" />
				            			</p:selectOneMenu>			            			 
			            			</h:panelGroup>            			
			            				<p:commandButton value="Hledej" actionListener="#{customBean.fillTeamListWithResultData}" action="pokus.xhtml?faces-redirect=true" />
			            			<h:panelGroup>
			            			</h:panelGroup>
			            		</h:panelGrid>	
			            		
			            		
			            		              <table class="center">
                  <tr>
                      <th>Pořadí</th>
                      <th colspan="2">Tým</th>
                      <th>Zápasy</th>
                      <th>V</th>
                      <th>R</th>
                      <th>P</th>
                      <th>Skóre</th>
                      <th>Body</th>
                  </tr>
                  
                  <c:forEach var="team"  items="#{customBean.teamList}" varStatus="status" >
	                  	<tr class="vedouci">
	                      <td>#{team.resultData.position}</td>
	                      <td><!-- <img src="../img/tym/olympiahk16.gif" /> --></td>
<!-- 	                      <td class="doleva"><a href="detailtymu.xhtml" style="color:black;">#{team.name}</a></td> -->
						  <td class="doleva"><span style="color:black;">#{team.name}</span></td>
	                      <td>#{team.resultData.matches}</td>
	                      <td>#{team.resultData.wins}</td>
	                      <td>#{team.resultData.draws}</td>
	                      <td>#{team.resultData.loss}</td>
	                      <td>#{team.resultData.scoredGoals}:#{team.resultData.collectedGoals}</td>
	                      <td>#{team.resultData.points}</td>
	                  	</tr>
                  </c:forEach>
              </table>  
              
              <br/>
              <br/>
			<h:selectOneMenu id="roundSelect" >
			  	<c:forEach varStatus="status" var="round" items="#{customBean.rounds}" >
			  		<f:selectItem itemValue="#{round}" />
			  	</c:forEach>
			</h:selectOneMenu>              
              
              
              		<table style="margin-top:0px;">
			                                  <th>Kolo</th>
						                      <th>Začátek</th>
						                      <th>Domácí</th>
						                      <th></th>
						                      <th>Hosté</th>
						                      <th>Skóre</th>
						                      <th></th>
			             <c:forEach varStatus="status" var="match" items="#{customBean.matchFilteredList }" >
						                   <tr>   
						                      <td style="width: 10%;" >#{match.round}</td>
						                      <td style="width: 25%;" >#{match.datum} - #{match.start}</td>
						                      <td style="width: 25%;" >#{match.homeTeam.name}</td>
						                      <td style="width: 5%;" >-</td>
					                    	  <td style="width: 25%;" >#{match.awayTeam.name}</td>
				                   		      <td style="width: 10%;">#{match.homeTeamScore}:#{match.awayTeamScore}</td>
				                     		  <td style="width: 15%;"><h:commandLink action="detailzapasu.xhtml" title="podrobnější informace o zápase" value="detail">
													    <f:setPropertyActionListener target="#{customBean.selectedMatch}" value="#{match}" />
												  </h:commandLink>
											  </td>		
				                		 </tr>	             		 	
			             </c:forEach>
			        </table> 
			            		
			            		
     </h:form>	 
  </body>
</html>